﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;

namespace Pyramid_Game
{
    public class PolygonStage01 : MakePloygon
    {
        public PolygonStage01(int size)
        {
            this.size = size;

            shape = new Rectangle[size];
            position = new Vector2[size];
            piece = new Texture2D[size];
            depth = new float[size];

            depth[0] = 1.0f;
            depth[1] = 1.0f;
            depth[2] = 1.0f;
            depth[3] = 1.0f;
            depth[4] = 1.0f;
            /*
            judgement.Add(new Rectangle(250 - margin / 2, 90 - margin / 2, margin, margin));
            judgement.Add(new Rectangle(400 - margin / 2, 90 - margin / 2, margin, margin));
            judgement.Add(new Rectangle(325 - margin / 2, 165 - margin / 2, margin, margin));
            judgement.Add(new Rectangle(250 - margin / 2, 240 - margin / 2, margin, margin));
            judgement.Add(new Rectangle(400 - margin / 2, 240 - margin / 2, margin, margin));
            */
            position[0] = new Vector2(250, 90);
            position[1] = new Vector2(400, 90);
            position[2] = new Vector2(325, 165);
            position[3] = new Vector2(250, 240);
            position[4] = new Vector2(400, 240);
        }

        public override void LoadContent(ContentManager content)
        {
            polygon = content.Load<Texture2D>("Texture/polygon/1_1");
            piece[0] = content.Load<Texture2D>("Texture/polygon/1_2");
            piece[1] = content.Load<Texture2D>("Texture/polygon/1_3");
            piece[2] = content.Load<Texture2D>("Texture/polygon/1_4");
            piece[3] = content.Load<Texture2D>("Texture/polygon/1_5");
            piece[4] = content.Load<Texture2D>("Texture/polygon/1_6");

            shape[0] = (new Rectangle(rand.Next(50, 750), rand.Next(30, 420), piece[0].Width, piece[0].Height));
            shape[1] = (new Rectangle(rand.Next(50, 750), rand.Next(30, 420), piece[1].Width, piece[1].Height));
            shape[2] = (new Rectangle(rand.Next(50, 750), rand.Next(30, 420), piece[2].Width, piece[2].Height));
            shape[3] = (new Rectangle(rand.Next(50, 750), rand.Next(30, 420), piece[3].Width, piece[3].Height));
            shape[4] = (new Rectangle(rand.Next(50, 750), rand.Next(30, 420), piece[4].Width, piece[4].Height));
        }

    }
}
